# coding: UTF-8
# @Date    ：2024/12/10 9:41 
# @File    : db_test.py
# :Author:  fum


from api.fm.models.system.config_model import User

from tests.test_base import box

db_manager = box.db_manager()

with db_manager.get_db_session() as session:
    users = []
    for i in range(10000):
        new_user = User(username=f"1_User{i}", email=f"user{i}@example.com")
        users.append(new_user)
    session.add_all(users)  # 一次性将所有用户添加到 session
    session.commit()  # 一次性提交所有数据
    print("All users added.")